xentrace: Move register_cpu_notifier() call into boot-time init.
authorKeir Fraser <keir@xen.org>
Wed, 6 Apr 2011 14:52:50 +0000 (15:52 +0100)
committerKeir Fraser <keir@xen.org>
Wed, 6 Apr 2011 14:52:50 +0000 (15:52 +0100)
We can't do it lazily from alloc_trace_bufs() as that gets called
later if tracing is enabled later by dom0.

Signed-off-by: Keir Fraser <keir@xen.org>
xen/common/trace.c

index 4225f0413fc47ca5b482316273ce6691ae356791..373a3dc022078d8ff5fc9f33d4816d7e8b41a772 100644 (file)
@@ -225,8 +225,6 @@ static int alloc_trace_bufs(unsigned int pages)
     t_buf_highwater = data_size >> 1; /* 50% high water */
     opt_tbuf_size = pages;
 
-    register_cpu_notifier(&cpu_nfb);
-
     printk("xentrace: initialised\n");
     wmb(); /* above must be visible before tb_init_done flag set */
     tb_init_done = 1;
@@ -309,6 +307,8 @@ int trace_will_trace_event(u32 event)
  */
 void __init init_trace_bufs(void)
 {
+    register_cpu_notifier(&cpu_nfb);
+
     if ( opt_tbuf_size && alloc_trace_bufs(opt_tbuf_size) )
     {
         printk(XENLOG_INFO "xentrace: allocation size %d failed, disabling\n",